﻿using TrueSync;

namespace HEFramework
{
    public static class HeroSystem
    {
        [EntitySystem]
        public class HeroAwakeSystem : AwakeSystem<Hero, int>
        {
            protected override void Awake(Hero _self, int _id)
            {
                _self.ID = _id;

                var ac = _self.AddChild<AttributeComponent, int, int>(_self.ID, 0);
                var tc = _self.AddChild<TransformComponent>();
                _self.AddChild<DeathComponent>();
                _self.AddChild<AlertComponent, int>(0);
                _self.AddChild<ATKComponent>();
                _self.AddChild<SkillComponent>();
                _self.AddChild<AISkillComponent>();
                _self.AddChild<RecoverComponent>();
                _self.AddChild<BlinkComponent>();
                _self.AddChild<SphereCollisionComponent, FP, TSVector, TSVector>(ac.Attribute.B_RAG, tc.P, TSVector.zero);
                _self.AddChild<HeroView>();
            }
        }
    }
}